package JSBank;

public class Transform {
	
	public static String SetBitmap009_012(String converstionRate, String transactionFee, String stan, String transactionTime) {
		
		String bitOne = "1";
		String bitTwo = "1";
		String bitThree = "1";
		String bitFour = "1";
		
		if ( converstionRate == null ) bitOne = "0"; 
		if ( transactionFee == null ) bitTwo = "0";
		if ( stan == null ) bitThree = "0";
		if ( transactionTime == null ) bitFour = "0";
		
		String value = Pack(bitOne, bitTwo, bitThree, bitFour);
		
		return value;
	}
	
	 private static String Pack(String bitOne, String bitTwo, String bitThree, String bitFour) {
		
		String value = "0";
		
		if ( bitOne == "0" && bitTwo == "0"  && bitThree == "0" && bitFour == "0" ) {
			value = "0";
		}
		
		if ( bitOne == "0" && bitTwo == "0"  && bitThree == "0" && bitFour == "1" ) {
			value = "1";
		}
		
		if ( bitOne == "0" && bitTwo == "0"  && bitThree == "1" && bitFour == "0" ) {
			value = "2";
		}
		
		if ( bitOne == "0" && bitTwo == "0"  && bitThree == "1" && bitFour == "1" ) {
			value = "3";
		}
		
		if ( bitOne == "0" && bitTwo == "1"  && bitThree == "0" && bitFour == "0" ) {
			value = "4";
		}
		
		if ( bitOne == "0" && bitTwo == "1"  && bitThree == "0" && bitFour == "1" ) {
			value = "5";
		}
		
		if ( bitOne == "0" && bitTwo == "1"  && bitThree == "1" && bitFour == "0" ) {
			value = "6";
		}
		
		if ( bitOne == "0" && bitTwo == "1"  && bitThree == "1" && bitFour == "1" ) {
			value = "7";
		}
		
		if ( bitOne == "1" && bitTwo == "0"  && bitThree == "0" && bitFour == "0" ) {
			value = "8";
		}
		
		if ( bitOne == "1" && bitTwo == "0"  && bitThree == "0" && bitFour == "1" ) {
			value = "9";
		}
		
		if ( bitOne == "1" && bitTwo == "0"  && bitThree == "1" && bitFour == "0" ) {
			value = "A";
		}
		
		if ( bitOne == "1" && bitTwo == "0"  && bitThree == "1" && bitFour == "1" ) {
			value = "B";
		}
		
		if ( bitOne == "1" && bitTwo == "1"  && bitThree == "0" && bitFour == "0" ) {
			value = "C";
		}
		
		if ( bitOne == "1" && bitTwo == "1"  && bitThree == "0" && bitFour == "1" ) {
			value = "D";
		}
		
		if ( bitOne == "1" && bitTwo == "1"  && bitThree == "1" && bitFour == "0" ) {
			value = "E";
		}
		
		if ( bitOne == "1" && bitTwo == "1"  && bitThree == "1" && bitFour == "1" ) {
			value = "F";
		}
		
		return value;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
	}

}
